package com.mes.biz.domain;

import javax.validation.Valid;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.mes.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.mes.common.utils.log.annotation.FieldRemark;
import com.mes.common.utils.log.annotation.LogField;
import com.mes.common.annotation.Excel;

/**
 * 采购单表头对象 biz_purchase_head
 * @author wy
 * @email wy
 * @date 2023-05-20
 */
@Data
public class BizPurchaseHead extends BaseEntity<BizPurchaseHead>
{
    private static final long serialVersionUID = 1L;

    /** 单据编号 */
    @Excel(name = "单据编号")
    @LogField
    @FieldRemark(name = "单据编号",field = "purchaseNo")
    private String purchaseNo;

    /** 项目号 */
    @Excel(name = "项目号")
    private String itemNumber;

    /** 供应商id */
    @Excel(name = "供应商id")
    @LogField
    @FieldRemark(name = "供应商id",field = "supplierId")
    private String supplierId;

    /** 仓库id */
    @Excel(name = "仓库id")
    @LogField
    @FieldRemark(name = "仓库id",field = "depotId")
    private String depotId;

    /** 单据日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
    @LogField
    @FieldRemark(name = "单据日期",field = "operTime")
    private Date operTime;

    /** 单据日期开始 */
    private String beginOperTime;

    /** 单据日期结束 */
    private String endOperTime;

    /** 采购金额 */
    @Excel(name = "采购金额")
    @LogField
    @FieldRemark(name = "采购金额",field = "purchaseAmount")
    private BigDecimal purchaseAmount;

    /** 付款金额 */
    @Excel(name = "付款金额")
    @LogField
    @FieldRemark(name = "付款金额",field = "changeAmount")
    private BigDecimal changeAmount;

    /** 审核状态 （按开发需求来） */
    @Excel(name = "审核状态 ", dictType = "sys_normal_disable")
    @LogField
    @FieldRemark(name = "审核状态 ",field = "auditStatus")
    private String auditStatus;

    /** 租户id */
    @NotBlank(message = "租户id不允许为空")
    @LogField
    @FieldRemark(name = "租户id",field = "tenantId")
    private String tenantId;

    private List<BizPurchaseDetail> purchaseDetailList;
    // 仓库名称
    private String warehouseName;
    //供应商
    private String supplierName;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("purchaseNo", getPurchaseNo())
            .append("itemNumber", getItemNumber())
            .append("supplierId", getSupplierId())
            .append("depotId", getDepotId())
            .append("operTime", getOperTime())
            .append("purchaseAmount", getPurchaseAmount())
            .append("changeAmount", getChangeAmount())
            .append("auditStatus", getAuditStatus())
            .append("tenantId", getTenantId())
            .append("remark", getRemark())
            .append("id", getId())
            .append("createBy", getCreateBy())
            .append("createDept", getCreateDept())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("updateIp", getUpdateIp())
            .append("version", getVersion())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
